# 构建的数据类型
import torch
# 移入绘图库
import matplotlib.pyplot as plt

noise = 0.2
# 簇类A(0.5,0.5) a label == 0
points_a = torch.normal(0.5, noise, (20, 2))
# A类的标签
labels_a = torch.zeros((20, 1))
# 将坐标和标签进行捆绑
features_a = torch.concatenate([points_a, labels_a], dim=1)
# 簇类B(1.5,1.5) a label == 1
points_b = torch.normal(1.5, noise, (20, 2))
# B类的标签
labels_b = torch.ones((20, 1))
# 将坐标和标签进行捆绑
features_b = torch.concatenate([points_b, labels_b], dim=1)
# 总的数据集
features = torch.concatenate([features_a, features_b], dim=0)
# 将数据集打乱顺序（为了得到的训练结果，训练集必须随机打乱顺序）
# 生成随机的点的序列  features = (40,3)
indices = torch.randperm(features.shape[0])
# 将features的顺序打乱
features = features[indices]
print(features)
